/**    
 * 文件名：${module}ServiceImpl.java
 * 版本信息:V1.00  
 * 日期：${createdTime} 
 * Copyright 深圳市佰仟金融服务有限公司版权所有
 */
package com.billionsfinance.crs.service.impl.${moduleType};

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.billionsfinance.crs.dao.${moduleType}.I${module}Dao;
import com.billionsfinance.crs.model.${moduleType}.${module};
import com.billionsfinance.crs.service.${moduleType}.I${module}Service;
import com.billionsfinance.crs.model.ResponseModel;
import com.billionsfinance.crs.model.PageResult;
import com.billionsfinance.crs.service.impl.BaseServiceImpl;
import com.billionsfinance.crs.request.PageReuqest;

/**
* ${hessianDesc} service实现类
* @FileName:${module}ServiceImpl.java
* @author:${createdName}
* @date:${createdTime}
* @Version:V1.00
*/
@Service("${lowModule}Service")
public class ${module}ServiceImpl extends BaseServiceImpl<${module}> implements I${module}Service{
	
	@Resource
	private I${module}Dao ${lowModule}Dao;

	@Override
	public List<${module}> find${module}List(${module} ${lowModule}) throws Exception{
		return ${lowModule}Dao.find${module}List(${lowModule});
	}
	
	@Override
	public PageResult<${module}> select${module}Set(${module} ${lowModule}, PageReuqest pageV0) throws Exception{
		return  ${lowModule}Dao.select${module}Set(${lowModule},pageV0);
	}
	
	 @Override
    public ResponseModel  createOrUpdate(${module} ${lowModule}) throws Exception{
    	ResponseModel responseModel=new ResponseModel();
    	this.setSaveOrUpdateInfo(${lowModule});
        responseModel.setNum(${lowModule}.getId() == null?${lowModule}Dao.create${module}(${lowModule}):${lowModule}Dao.update${module}(${lowModule}));
        responseModel.setObject(${lowModule});
        return responseModel;
    }
	
    @Override
    public int  createOrUpdate${module}(${module} ${lowModule}) throws Exception{
    	this.setSaveOrUpdateInfo(${lowModule});
        return ${lowModule}.getId()==null?${lowModule}Dao.create${module}(${lowModule}):${lowModule}Dao.update${module}(${lowModule});
    }
    @Override
    public ${module} read${module}ById(Long id) throws Exception{
        return ${lowModule}Dao.read${module}ById(id);
    }
    @Override
    public int delete${module}ById(Long id) throws Exception{
        return ${lowModule}Dao.delete${module}ById(id);
    }
    @Override
    public int physicalDelete${module}ById(Long id) throws Exception{
    	return ${lowModule}Dao.physicalDelete${module}ById(id);
    }
  
}
